; Kyle Kelly
; CS1221-B2
; Lab10
; Multiply in assembly


.orig x3000	 
LD R0, OPA
LD R1, OPB
LD R6, OUTPUT
AND R3, R3, #0  ; Clear out R3 to use as a counter. 
AND R2, R2, #0  ; Clear out R2 to use as return register.
LOOP
ADD R2, R2, R0 ; "Multiply" by the next integer
ADD R3, R3, #1 ; Increment counter
NOT R4, R3	   ; NOT opb to use for comparison
ADD R4, R4, R1 ; ADD for comparison
NOT R4, R4		; NOT again to hopefully get zero
BRNP LOOP
STR R2, R6, #0

HALT

.orig x5000
OPA .BLKWDS 1
OPB .BLKWDS 1
OUTPUT .BLKWDS 1
.end